package comm.data;


import lombok.Data;

import java.util.Calendar;

@Data
public class PuhuiPlatFormResponseData {

    //设备ID
    public String dvo;

    //命令码
    public int commandCode;

    //数据域(返回的是当前时间，年月日时分秒各1各字节)
    public int year;

    public int month;

    public int day;

    public int hour;

    public int minute;

    public int second;


    public PuhuiPlatFormResponseData(PuhuiPackageData data) {
        Calendar rightNow = Calendar.getInstance();
        this.dvo = data.dvo;
        this.commandCode = data.commandCode;
        this.year = rightNow.get(Calendar.YEAR);
        this.month = rightNow.get(Calendar.MONTH)+1; //第一个月从0开始，所以得到月份＋1
        this.day = rightNow.get(rightNow.DAY_OF_MONTH);
        this.hour = rightNow.get(rightNow.HOUR_OF_DAY);
        this.minute = rightNow.get(rightNow.MINUTE);
        this.second = rightNow.get(rightNow.SECOND);
    }






}
